package com.yaodian100.crm.activities.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "CRM_PROMOTION_PRESENT")
public class PromotionPresent implements Serializable {

	// ID NUMBER No 1 编号
	// PR_ID NUMBER Yes 2 活动编号
	// SPEC_ID NUMBER Yes 3 赠品编号
	// QTY NUMBER Yes 4 数量
	//
	// AFNJ_QTY

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(length = 32)
	private String id;
	/**
	 * 活动编号
	 */

	@Column(name = "PR_ID", length = 32)
	private String prId;
	/**
	 * 赠品编号
	 */
	@Column(name = "SPEC_ID")
	private Long specId;
	/**
	 * 数量
	 */
	@Column(name = "QTY")
	private int qty;
	/**
	 * 已用数量
	 */
	@Column(name = "AFNJ_QTY")
	private int afnjQty;

	@Transient
	public int getInventory() {
		return qty - afnjQty;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getPrId() {
		return prId;
	}

	public void setPrId(String prId) {
		this.prId = prId;
	}

	public Long getSpecId() {
		return specId;
	}

	public void setSpecId(Long specId) {
		this.specId = specId;
	}

	public int getQty() {
		return qty;
	}

	public void setQty(int qty) {
		this.qty = qty;
	}

	public int getAfnjQty() {
		return afnjQty;
	}

	public void setAfnjQty(int afnjQty) {
		this.afnjQty = afnjQty;
	}

}
